package com.whiteape.book.common;

import android.graphics.Color;

import androidx.annotation.StringDef;

import com.whiteape.book.utils.FileUtils;

import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.HashMap;
import java.util.Map;

public class WaConstants {
    public static boolean DEBUG = true;
    public static final int FIX_THREAD_NUM = 8;

    /*SharedPreference*/
    public static final String SHARED_SEX = "sex";
    public static final String SHARED_SAVE_BOOK_SORT = "book_sort";
    public static final String SHARED_SAVE_BILLBOARD = "billboard";
    public static final String SHARED_CONVERT_TYPE = "convert_type";
    public static final String SEX_BOY = "boy";
    public static final String SEX_GIRL = "girl";

    /*URL_BASE*/
    public static final String API_BASE_URL = "http://api.zhuishushenqi.com";
    public static final String IMG_BASE_URL = "http://statics.zhuishushenqi.com";
    //book type
    public static final String BOOK_TYPE_COMMENT = "normal";
    public static final String BOOK_TYPE_VOTE = "vote";
    //book state
    public static final String BOOK_STATE_NORMAL = "normal";
    public static final String BOOK_STATE_DISTILLATE = "distillate";
    //Book Date Convert Format
    public static final String FORMAT_BOOK_DATE = "yyyy-MM-dd'T'HH:mm:ss";
    public static final String FORMAT_TIME = "HH:mm";
    public static final String FORMAT_FILE_DATE = "yyyy-MM-dd";
    //RxBus
    public static final int MSG_SELECTOR = 1;
    //BookCachePath (因为getCachePath引用了Context，所以必须是静态变量，不能够是静态常量)
    public static String MEDIA_CACHE_PATH = FileUtils.getCachePath()+ File.separator
            + "book_cache"+ File.separator ;
    public static String FONT_CACHE_PATH = FileUtils.getCachePath()+ File.separator
            + "fonts"+ File.separator ;

    public static String JS_CACHE_PATH = FileUtils.getCachePath()+ File.separator
            + "js_cache"+ File.separator ;

    //文件阅读记录保存的路径
    public static String BOOK_RECORD_PATH = FileUtils.getCachePath() + File.separator
            + "book_record" + File.separator;


    //BookType
    @StringDef({
            BookType.ALL,
            BookType.XHQH,
            BookType.WXXX,
            BookType.DSYN,
            BookType.LSJS,
            BookType.YXJJ,
            BookType.KHLY,
            BookType.CYJK,
            BookType.HMZC,
            BookType.XDYQ,
            BookType.GDYQ,
            BookType.HXYQ,
            BookType.DMTR
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface BookType {
        String ALL = "all";

        String XHQH = "xhqh";

        String WXXX = "wxxx";

        String DSYN = "dsyn";

        String LSJS = "lsjs";

        String YXJJ = "yxjj";
        String KHLY = "khly";
        String CYJK = "cyjk";
        String HMZC = "hmzc";
        String XDYQ = "xdyq";
        String GDYQ = "gdyq";
        String HXYQ = "hxyq";
        String DMTR = "dmtr";
    }

    public static Map<String, String> bookType = new HashMap<String, String>() {{
        put("qt", "其他");
        put(BookType.XHQH, "玄幻奇幻");
        put(BookType.WXXX, "武侠仙侠");
        put(BookType.DSYN, "都市异能");
        put(BookType.LSJS, "历史军事");
        put(BookType.YXJJ, "游戏竞技");
        put(BookType.KHLY, "科幻灵异");
        put(BookType.CYJK, "穿越架空");
        put(BookType.HMZC, "豪门总裁");
        put(BookType.XDYQ, "现代言情");
        put(BookType.GDYQ, "古代言情");
        put(BookType.HXYQ, "幻想言情");
        put(BookType.DMTR, "耽美同人");
    }};



    public static final String ZSSQ_API_BASE_URL = "http://api.zhuishushenqi.com";
    public static final String ZSSQ_IMG_BASE_URL = "http://statics.zhuishushenqi.com";


    public final static int RIGHT_TO_LEFT =0;
    public final static int LEFT_TO_RIGHT =1;
    public final static int UP_TO_DOWN = 2;

    public static final String UMENG_APPID = "5dbac69b0cafb26c0f000319";
    public static final String UMENG_APPID_BAK = "609266a9c9aacd3bd4c15dcc";
    public static final String UMENG_APP_QILIN = "6275aa6230a4f67780cb4f4f";

    public static final String BUGLY_APP_ID = "4c92017161";
    public static final String BUGLY_APP_ID_QILIN = "19a09d34a8";

    public static final String BUGLY_APP_KEY = "df91fc46-4f21-4523-b744-6630a85bd629";

    public static final String WX_APPID = "wxa0b97057a6018b14";
    public static final String WX_APP_SECRET = "86231767ccdcedc043e8bdf89c42184b";

    public static final String QQ_APPID = "101724071";
    public static final String QQ_APP_KEY = "848daf82d11e4bdee0b993c6a6cb74ef";

    public static final String YZS_APPKEY = "buf2goj7kqjafyfmoty3pen6jkjblv2imfcafhif";
    public static final String YZS_SECRET = "88862481210c4370fea828602c7e4aa2";

    public static final String IFLY_AD_APPID = "5ebaacde";
    public static final String IFLY_AD_UNITID = "D52E3664B160B30F9CF52AFE5C5B54B1";

    public static final String TOUTIAO_AD_APPID = "5096102";
//    public static final String TOUTIAO_AD_UNITID = "887361505";
    public static final String TOUTIAO_AD_UNITID = "887362681";

//    public static final String TOUTIAO_AD_APPID = "5062025";
//    public static final String TOUTIAO_AD_UNITID = "887317657";

    public static final String MINTEGRAL_APPID = "134301";
    public static final String MINTEGRAL_APPKEY = "04f8efef2fb40fd9ddf4a803d52ddcd4";
    public static final String MINTEGRAL_PLACEMENT_ID = "231764";
    public static final String MINTEGRAL_UNITE_ID = "329447";

    public static final String BAIDU_MSSP_APPID = "e618ec49";
    public static final String BAIDU_MSSP_SPLASH_ID = "7204300";
//
//    public static final String MINTEGRAL_APPID = "118690";
//    public static final String MINTEGRAL_APPKEY = "7c22942b749fe6a6e361b675e96b3ee9";
//    public static final String MINTEGRAL_PLACEMENT_ID = "173349";
//    public static final String MINTEGRAL_UNITE_ID = "209547";

    public static final int[] tagColors = new int[]{
            Color.parseColor("#90C5F0"),
            Color.parseColor("#91CED5"),
            Color.parseColor("#F88F55"),
            Color.parseColor("#C0AFD0"),
            Color.parseColor("#E78F8F"),
            Color.parseColor("#67CCB7"),
            Color.parseColor("#F6BC7E")
    };

    public static final String URL_HOW_TO_IMPORT_SOURCE = "http://fortianwei.gitee.io/whiteape/#/guide/rule";

    public static final String URL_HOW_TO_CREATE_SOURCE = "http://fortianwei.gitee.io/whiteape/#/example/rule";

    public static final String CU_URL = "http://127.0.0.1:8080/woc";

}
